package com.eastjet.maintenance.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eastjet.maintenance.domain.InboundDetails;
import com.eastjet.maintenance.mapper.InboundDetailsMapper;
import com.eastjet.maintenance.service.InboundDetailsService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨博文
 * @description 针对表【inbound_details(入库明细)】的数据库操作Service实现
 * @createDate 2024-11-25 09:23:38
 */
@Service
public class InboundDetailsServiceImpl extends ServiceImpl<InboundDetailsMapper, InboundDetails> implements InboundDetailsService {

    /*
     * 入库明细新增
     */
    @Override
    public Boolean InsertRu(List<InboundDetails> inboundDetails) {
        return this.saveBatch(inboundDetails);
    }

    /*
     * 新增出库明细
     */
    @Override
    public Boolean InsertChu(List<InboundDetails> inboundDetails) {
        return this.saveBatch(inboundDetails);
    }

    /*
     * 明细删除
     */
    @Override
    public Boolean DeleteRu(List<InboundDetails> inboundDetails) {
        return this.updateBatchById(inboundDetails);
    }

    /*
     * 明细查询
     */
    @Override
    public List<InboundDetails> GetAllRu(String code) {
        return this.list(new QueryWrapper<InboundDetails>().and(i -> i.eq("discrepancy_code", code).eq("tombstone", 0)));
    }
}




